<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
         contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>场地管理 - 体育馆网上系统后台</title>
    <link href=" ${pageContext.request.contextPath}/static/cssa/nav.css" rel="stylesheet" type="text/css"/>
    <script src="${pageContext.request.contextPath}/static/js/nav.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/focus.js" type="text/javascript"></script>
    <link href=" ${pageContext.request.contextPath}/static/cssa/common.css" rel="stylesheet" type="text/css"/>
    <link href=" ${pageContext.request.contextPath}/static/cssa/ground.css" rel="stylesheet" type="text/css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery-2.1.1.js"></script>

    <script type="text/javascript">
      function adminDelete(obj, placeID) {
        var t = obj.parentNode.parentNode;
        if (confirm("确定删除吗？")) {
          $.ajax(
            {
              url: "${pageContext.request.contextPath}/place/delete?placeID=" + placeID,
              success: function (res) {
                if (res.indexOf("success") != -1) {
                  alert(res);
                  t.remove();
                } else {
                  alert(res);
                }
              }
            }
          )
        }
      }
    </script>
</head>

<body>
<%@ include file="../header.jsp" %>
<div id="main">
    <div id="row_1">
        <table class="ground-list" cellspacing="2px">
            <tr>
                <th scope="col"> 场地编号</th>
                <th scope="col"> 名称</th>
                <th scope="col"> 类型</th>
                <th scope="col"> 资费</th>
                <th scope="col" class="book"> 操作</th>
            </tr>
            <c:forEach items="${places}" var="list">
                <tr>
                    <td> ${list.PLACEID} </td>
                    <td> ${list.PLACENAME} </td>
                    <td> ${list.TYPENAME} </td>
                    <td> ${list.MONEY} </td>
                    <td class="align-center">
                        <a href="" onclick="adminDelete(this,${list.PLACEID})">删除</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
</div>
<script>
  var def = "4";
</script>
<%@ include file="../footer.jsp" %>
</body>
</html>
